package com.fy.login.permissions;

import java.security.Permission;
import java.util.Objects;

/**
 * @author zhufeifei 2022/8/7
 **/

public class EventListenerPermission extends Permission {

    /**
     * Constructs a permission with the specified name.
     *
     * @param name name of the Permission object being created.
     */
    public EventListenerPermission(String name) {
        super(name);
    }

    @Override
    public boolean implies(Permission permission) {
        Objects.requireNonNull(permission);
        return this.getName().equals(permission.getName());
    }

    @Override
    public boolean equals(Object obj) {
        if (! (obj instanceof EventListenerPermission) ) {
            return false;
        }
        EventListenerPermission other = (EventListenerPermission) obj;
        return this.getName().equals(other.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getName());
    }

    @Override
    public String getActions() {
        return "";
    }
}
